<?php
class Act extends Doctrine_Record
{
    public function setTableDefinition()
    {
        $this->hasColumn('company_id', 'integer', 20);
        $this->hasColumn('user_id', 'integer', 20);
        $this->hasColumn('employer_id', 'integer', 20);
        $this->hasColumn('data', 'date');
        $this->hasColumn('job_place', 'string', 200);
        $this->hasColumn('job_remote', 'integer', 1);
        $this->hasColumn('start_time', 'timestamp');
        $this->hasColumn('end_time', 'timestamp');
        $this->hasColumn('job_report', 'string', 1000);
        $this->hasColumn('materials', 'string', 1000 );
        $this->hasColumn('comments', 'string', 1000);        
        $this->hasColumn('aproove', 'integer', 1);
        $this->hasColumn('print', 'integer', 1);
        $this->hasColumn('aproove_time', 'timestamp');
        $this->hasColumn('draft', 'integer', 1);
        $this->hasColumn('report_key', 'string', 255);
    }
    public function setUp()
    {
        $this->actAs('Timestampable');
        $this->hasMany('Act_computer as Act_computers', array(
                'local' => 'id',
                'foreign' => 'act_id'
            )
        );
        $this->hasOne('Company', array(
                'local' => 'company_id',
                'foreign' => 'id'
            )
        );
        $this->hasOne('User', array(
                'local' => 'user_id',
                'foreign' => 'id'
            )
        );
    }
  
}


